Skip to content

Don't populate IdentifierCollection errors with empty nested arrays#739

Merged
dereuromark merged 1 commit into3.xfrom
identifier-collection-errors
Sep 6, 2025
Merged

Don't populate IdentifierCollection errors with empty nested arrays#739
dereuromark merged 1 commit into3.xfrom
identifier-collection-errors

Conversation

@ADmad
Copy link
Copy Markdown
Member

@ADmad ADmad commented Sep 6, 2025

Before this fix using $result->getErrors() would return ['Password' => []] when using form authenticate with a non existent user.

@dereuromark dereuromark merged commit 20c06b7 into 3.x Sep 6, 2025
6 of 8 checks passed
@dereuromark dereuromark deleted the identifier-collection-errors branch September 6, 2025 12:40
@ADmad
Copy link
Copy Markdown
Member Author

ADmad commented Sep 6, 2025

In the future we also need to fix this inconsistency of errors returned by Result::getErrors().

If an authenticator directly sets the result's errors you would get a numerically indexed array like [0 => 'foo'] but if the an identifier returns errors then the IdentifierCollection nests them using the identifier name as key and Result::getErrors() would return something like ['IdentifierName' => [0 => 'foo']].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants